#ifndef INFORMATION_H
#define INFORMATION_H
#include <QObject>

class Information
{
public:
    // Implementing the standard C++11 singleton pattern
    // The singleton instance getter
    static Information & get()
    {
      static Information instance;

      return instance;
    }
    Information();
    struct clientToServerDataPackage {
        char   Head[4];
        qint16 DateType;
        qint16 CrcReturn;
        qint16 TruckID;
        qint16 TruckStart;
        qint16 RtkWarming;
        qint16 ShangWeiJiZhuangTai;
        qint16 MotorSpeed;
        qint16 DCImportCurrent;
        qint16 DianZiDangState;
        qint16 JiXieDangState;
        qint16 GuZhangLevel;
        qint16 BatSOC;
        qint16 XingCheZhuangTai;
        qint16 NSV1;
        qint16 NSV2;
        qint16 Time[3];
        qint32 ErrCode;
        qint32 BaoLiu;
        double LeftWheelAngle;
        double TruckSpeed;
        double Lattitude;
        double Longitude;
        double Altitude;
        double Heading;
        double ThrottleVal;
        unsigned int CRC32;
        char   End[4];
    }CTS_Data;
    struct clientToServerFilePackage {
        char   Head[4];
        qint16 DateType;
        qint16 CrcReturn;
        qint16 PackagesNum;
        qint16 PackagesId;
        qint16 TruckId;
        qint32 DataLen;
        char   FileName[32];
        char   FileData[512];
        qint32 CRC32;
        char   End[4];
    }CTS_File;
    struct receiveDataPackage{
        char Head[4];
        qint16 DateType;
        qint16 TruckStart;
        char   End[4];
    }empData;
    void processDataPackage(QJsonObject jsonObject);
    void processFilePackage(QJsonObject jsonObject);
    void processTelecontrolPackage(QJsonObject jsonObject);
    bool networkStatic;
    QJsonObject getSendToClientDataPackage();
};

#endif // INFORMATION_H
